package com.game.majiang.vo;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import javax.sql.rowset.CachedRowSet;

import com.game.server.db.SqlHelper;

import lombok.Data;
import lombok.extern.log4j.Log4j;

@Data
@Log4j
public class PackageTypeVo {

	int rmb;
	int fangka;
	
	public List<PackageTypeVo>  getgoumaifangka() {
		String sql="select rmborgold,fangka from package_type where type=0";
		CachedRowSet rs = SqlHelper.getResultSet(sql);
		List<PackageTypeVo> list= new ArrayList<PackageTypeVo>();
		try {
			while (rs.next()) 
			{
				PackageTypeVo p = new PackageTypeVo();
				p.setRmb(rs.getInt(1));
				p.setFangka(rs.getInt(2));
				list.add(p);
			}
		} catch (SQLException e) {
			e.printStackTrace();
			log.warn("Sql:" + sql + "错误!");
		}
		return list;
	}
	public List<PackageTypeVo>  getgoumaijinbi() {
		String sql="select rmborgold,fangka from package_type where type=1";
		CachedRowSet rs = SqlHelper.getResultSet(sql);
		List<PackageTypeVo> list= new ArrayList<PackageTypeVo>();
		try {
			while (rs.next()) 
			{
				PackageTypeVo p = new PackageTypeVo();
				p.setRmb(rs.getInt(1));
				p.setFangka(rs.getInt(2));
				list.add(p);
			}
		} catch (SQLException e) {
			e.printStackTrace();
			log.warn("Sql:" + sql + "错误!");
		}
		return list;
	}
	
}
